package com.winxuan.channel.service.commodity.impl;

import java.util.Map;

import com.winxuan.support.dao.ParametersFinder;

public class CommoditySanpFinder extends ParametersFinder{
	
	private Map parms;
	
	public CommoditySanpFinder(Map<String, Object> parms) {
		super(parms);
		this.parms = parms;
	}
	
	@Override
	public String genQueryString() {
		Map<String,Object> params = getParameters();
		StringBuffer sb=new StringBuffer("SELECT s FROM CommoditySnap s WHERE 1=1");
		if(params.get("distribute") != null){
			sb.append(" AND s.commoditySnapPK.distribute=:distribute ");
		}
		if(params.get("commodity") != null){
			sb.append(" AND s.commoditySnapPK.commodity=:commodity ");
		}
		if(params.get("beginLastUpdateTime")!=null){
			sb.append(" AND s.lastupdatetime<:beginLastUpdateTime");
		}
		return sb.toString();
	}


}
